package com.sczmgk.hotline_pzh.ui;

import android.os.Bundle;
import android.os.Message;
import android.view.View;
import android.widget.TextView;

import com.sczmgk.hotline_pzh.R;
import com.sczmgk.hotline_pzh.base.BaseActivity;
import com.sczmgk.hotline_pzh.utils.CommonUtils;
import com.sczmgk.hotline_pzh.utils.UIUtils;

import static com.sczmgk.hotline_pzh.constants.Constants.BANNER_DETAIL_INFO;

/**
 * Created by Administrator on 2016/12/9 0009.
 */

public class AboutUsActivity extends BaseActivity {

    private TextView mTvWeiXin;
    private TextView mTvCustomerNum;
    private TextView mTvWeb;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_about_us);

        setHeader() ;

        initView() ;

        setListener() ;
    }

    private void setListener() {
        mTvCustomerNum.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                CommonUtils.callPhone(AboutUsActivity.this , mTvCustomerNum.getText().toString().trim());
            }
        });

        mTvWeb.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String webUrl = "http://" + mTvWeb.getText().toString().trim() + "/";
                UIUtils.startActivity(AboutUsActivity.this , BannerDetailActivity.class , BANNER_DETAIL_INFO , webUrl);
            }
        });
    }

    private void setHeader() {
        setTitle(R.string.about_us);
        setLeftBtnVisibility(View.VISIBLE);
    }

    private void initView() {
        mTvWeiXin = (TextView) findViewById(R.id.tv_about_us_wx);
        mTvCustomerNum = (TextView) findViewById(R.id.tv_about_us_customer_service_num);
        mTvWeb = (TextView) findViewById(R.id.tv_about_us_this_official_website);
    }

    @Override
    public void handleMessage(Message msg) {

    }

    @Override
    public boolean getIsNeedLogin() {
        return false;
    }
}
